#pragma once

#include <sys/epoll.h>
#include <vector>

class Reactor
{
public:
    Reactor();
    ~Reactor();
    void Poll(std::vector<int>& readyfd);
    void AddFd(int fd, int event);
    void RmvFd(int fd);
    void ModFd(int fd, int event);
private:
    int epfd { -1 };
    int wakefd { -1 };   // used to wakeup epoll_wait
    struct epoll_event events[1024];
};